package vn.allmobile.ambnews.customview;

import vn.allmobile.ambnews.utils.Log;
import android.graphics.Bitmap;
import android.net.Uri;
import android.webkit.WebView;
import android.webkit.WebViewClient;

public class WebviewDetailClientForCache extends WebViewClient {

	/* (non-Javadoc)
	 * @see android.webkit.WebViewClient#shouldOverrideUrlLoading(android.webkit.WebView, java.lang.String)
	 */
	@Override
	public boolean shouldOverrideUrlLoading(WebView view, String url) {
		// TODO Auto-generated method stub
		
		Uri uri = Uri.parse(url);
        String scheme = uri.getScheme();	
		 if (scheme.equals("ambflip")) {
			 view.loadUrl("javascript: window.SLBridge.setReady(true);"); 
			 return true;
		 }
		 return false;
	}

	/* (non-Javadoc)
	 * @see android.webkit.WebViewClient#onPageFinished(android.webkit.WebView, java.lang.String)
	 */
	@Override
	public void onPageFinished(WebView view, String url) {
		// TODO Auto-generated method stub
		super.onPageFinished(view, url);
		Log.v("finish loading:" + url);
	}

	/* (non-Javadoc)
	 * @see android.webkit.WebViewClient#onPageStarted(android.webkit.WebView, java.lang.String, android.graphics.Bitmap)
	 */
	@Override
	public void onPageStarted(WebView view, String url, Bitmap favicon) {
		// TODO Auto-generated method stub
		super.onPageStarted(view, url, favicon);
		Log.v("start loading:" + url);
	}
	
	
	
	
}
